<!DOCTYPE html>
<html lang="en-US">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>指南 | 微采助手</title>
    <meta name="description" content="一个以NodeJs驱动的公众号文章采集工具。">
    
    
    <link rel="preload" href="/assets/css/0.styles.d618c2f3.css" as="style"><link rel="preload" href="/assets/js/app.c7adfe4a.js" as="script"><link rel="preload" href="/assets/js/2.4e4a3910.js" as="script"><link rel="preload" href="/assets/js/4.ef8676b3.js" as="script"><link rel="prefetch" href="/assets/js/3.30d469d5.js"><link rel="prefetch" href="/assets/js/5.c61e9591.js"><link rel="prefetch" href="/assets/js/6.1e78a955.js"><link rel="prefetch" href="/assets/js/7.98ea14f6.js">
    <link rel="stylesheet" href="/assets/css/0.styles.d618c2f3.css">
  </head>
  <body>
    <div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/" class="home-link router-link-active"><!----> <span class="site-name">微采助手</span></a> <div class="links"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><a href="/" class="nav-link">首页</a></div><div class="nav-item"><a href="/guide/" class="nav-link router-link-exact-active router-link-active">指南</a></div><div class="nav-item"><a href="https://github.com/lunnlew/weicai-scraper/" target="_blank" rel="noopener noreferrer" class="nav-link external">
  GitHub
  <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></div> <!----></nav></div></header> <div class="sidebar-mask"></div> <aside class="sidebar"><nav class="nav-links"><div class="nav-item"><a href="/" class="nav-link">首页</a></div><div class="nav-item"><a href="/guide/" class="nav-link router-link-exact-active router-link-active">指南</a></div><div class="nav-item"><a href="https://github.com/lunnlew/weicai-scraper/" target="_blank" rel="noopener noreferrer" class="nav-link external">
  GitHub
  <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></div> <!----></nav>  <ul class="sidebar-links"><li><section class="sidebar-group depth-0"><p class="sidebar-heading open"><span>指南</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/guide/#介绍" class="sidebar-link">介绍</a><ul class="sidebar-sub-headers"></ul></li><li><a href="/guide/#支持平台" class="sidebar-link">支持平台</a><ul class="sidebar-sub-headers"></ul></li><li><a href="/guide/#功能" class="sidebar-link">功能</a><ul class="sidebar-sub-headers"></ul></li><li><a href="/guide/#安装" class="sidebar-link">安装</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/guide/#安装包" class="sidebar-link">安装包</a></li><li class="sidebar-sub-header"><a href="/guide/#百度源" class="sidebar-link">百度源</a></li></ul></li><li><a href="/guide/#使用" class="sidebar-link">使用</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/guide/#使用前设置" class="sidebar-link">使用前设置</a></li><li class="sidebar-sub-header"><a href="/guide/#使用前注意" class="sidebar-link">使用前注意</a></li><li class="sidebar-sub-header"><a href="/guide/#代理模式" class="sidebar-link">代理模式</a></li><li class="sidebar-sub-header"><a href="/guide/#监控模式" class="sidebar-link">监控模式</a></li></ul></li><li><a href="/guide/#开发" class="sidebar-link">开发</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/guide/#技术栈及语言" class="sidebar-link">技术栈及语言</a></li><li class="sidebar-sub-header"><a href="/guide/#系统开发环境" class="sidebar-link">系统开发环境</a></li><li class="sidebar-sub-header"><a href="/guide/#安装nvm" class="sidebar-link">安装nvm</a></li><li class="sidebar-sub-header"><a href="/guide/#安装nodejs" class="sidebar-link">安装Nodejs</a></li><li class="sidebar-sub-header"><a href="/guide/#安装yarn" class="sidebar-link">安装yarn</a></li><li class="sidebar-sub-header"><a href="/guide/#更新依赖" class="sidebar-link">更新依赖</a></li><li class="sidebar-sub-header"><a href="/guide/#安装python-2-7" class="sidebar-link">安装Python 2.7</a></li><li class="sidebar-sub-header"><a href="/guide/#安装visual-studio-2017" class="sidebar-link">安装Visual Studio 2017</a></li></ul></li><li><a href="/guide/#下载源码" class="sidebar-link">下载源码</a><ul class="sidebar-sub-headers"></ul></li><li><a href="/guide/#编译打包" class="sidebar-link">编译打包</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/guide/#编译weicaibinding" class="sidebar-link">编译WeicaiBinding</a></li><li class="sidebar-sub-header"><a href="/guide/#编译wechatctl" class="sidebar-link">编译WeChatCtl</a></li><li class="sidebar-sub-header"><a href="/guide/#编译wechathelper" class="sidebar-link">编译WeChatHelper</a></li><li class="sidebar-sub-header"><a href="/guide/#运行开发模式" class="sidebar-link">运行开发模式</a></li><li class="sidebar-sub-header"><a href="/guide/#打包主程序" class="sidebar-link">打包主程序</a></li></ul></li><li><a href="/guide/#调试远程注入dll" class="sidebar-link">调试远程注入DLL</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/guide/#编译wechathelper-2" class="sidebar-link">编译WeChatHelper</a></li><li class="sidebar-sub-header"><a href="/guide/#编译detours" class="sidebar-link">编译Detours</a></li><li class="sidebar-sub-header"><a href="/guide/#修改原始程序iat" class="sidebar-link">修改原始程序IAT</a></li><li class="sidebar-sub-header"><a href="/guide/#配置vs2017的本地调试设置" class="sidebar-link">配置vs2017的本地调试设置</a></li><li class="sidebar-sub-header"><a href="/guide/#运行调试" class="sidebar-link">运行调试</a></li></ul></li><li><a href="/guide/#文档生成" class="sidebar-link">文档生成</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/guide/#安装vuepress" class="sidebar-link">安装vuepress</a></li><li class="sidebar-sub-header"><a href="/guide/#构建文档" class="sidebar-link">构建文档</a></li></ul></li><li><a href="/guide/#开源许可" class="sidebar-link">开源许可</a><ul class="sidebar-sub-headers"></ul></li></ul></section></li></ul> </aside> <main class="page"> <div class="theme-default-content content__default"><h1 id="指南"><a href="#指南" class="header-anchor">#</a> 指南</h1> <blockquote><p>声明!</p> <p>本项目仅供技术研究及个人学习使用，请勿用于任何商业用途，请勿用于非法用途，如有任何人凭此做任何非法事情，均于作者无关，特此声明。</p></blockquote> <h2 id="介绍"><a href="#介绍" class="header-anchor">#</a> 介绍</h2> <p>微采助手是一个以NodeJs驱动的公众号文章采集工具，为了支持更方便地采集和本地浏览而创建并开源的。
当你浏览微信公众号发现一个有趣的文章时，你就可以使用它下载该资源以用于本地浏览存储等。
<img src="/assets/img/1.fcce54ca.png" alt="1"></p> <h2 id="支持平台"><a href="#支持平台" class="header-anchor">#</a> 支持平台</h2> <p>目前仅支持window10 x64</p> <h2 id="功能"><a href="#功能" class="header-anchor">#</a> 功能</h2> <ol><li>公众号历史文章采集</li> <li>文章列表查看及搜索，包含标题，发布时间，链接等</li> <li>支持手动生成文章图片，也支持后台批量生成图片任务模式</li> <li>文章阅读数，点赞数，赞赏量，评论数采集</li> <li>文章评论数据采集</li> <li>公众号列表查看及搜索，包含名称等</li> <li>简化的采集代理设置操作</li></ol> <h2 id="安装"><a href="#安装" class="header-anchor">#</a> 安装</h2> <h3 id="安装包"><a href="#安装包" class="header-anchor">#</a> 安装包</h3> <table><thead><tr><th style="text-align:center;">操作系统</th> <th style="text-align:center;">二进制包</th></tr></thead> <tbody><tr><td style="text-align:center;">winx64</td> <td style="text-align:center;"><a href="https://github.com/lunnlew/weicai-scraper/releases/download/v0.1.8/Setup-x86-0.1.8.exe" target="_blank" rel="noopener noreferrer">微采助手-Setup-x86-0.1.8.exe<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></td></tr></tbody></table> <h3 id="百度源"><a href="#百度源" class="header-anchor">#</a> 百度源</h3> <p><a href="https://pan.baidu.com/s/1IB1343C4_3pa1bbwnWB0jw" target="_blank" rel="noopener noreferrer">微采助手-Setup-x86.exe<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></p> <h2 id="使用"><a href="#使用" class="header-anchor">#</a> 使用</h2> <h3 id="使用前设置"><a href="#使用前设置" class="header-anchor">#</a> 使用前设置</h3> <div class="language-powershell extra-class"><pre class="language-powershell"><code><span class="token comment">## 在powershell(管理员模式)设置执行策略</span>
<span class="token comment">## 设置采集代理模式时的脚本动作需要</span>
<span class="token function">Set</span><span class="token operator">-</span>ExecutionPolicy <span class="token operator">-</span>ExecutionPolicy Unrestricted <span class="token operator">-</span>Scope CurrentUser
</code></pre></div><h3 id="使用前注意"><a href="#使用前注意" class="header-anchor">#</a> 使用前注意</h3> <blockquote><p><strong>公众号历史文章列表页不要频繁进行访问刷新，否则会导致提示<code>操作频繁</code>并封禁该接口访问24小时</strong>。</p></blockquote> <h3 id="代理模式"><a href="#代理模式" class="header-anchor">#</a> 代理模式</h3> <p>代理模式是在开启系统代理设置时，通过操作微信客户端访问并拦截内容来达成对<code>历史文章列表</code>，<code>文章页</code>，<code>文章评论数据</code>，<code>公众号信息</code>等采集。</p> <ol><li><p>如何使用</p> <p>打开<code>微采助手</code>，进入点击<code>开始管理</code>进入主界面，然后启用<code>采集代理</code>开关即可。</p></li> <li><p>如何采集历史文章页</p> <p>在处于<code>采集代理模式</code>时，打开你想要采集的公众号的<code>历史文章列表</code>页面即可，注意：首次打开<code>历史文章列表</code>页面的时候，建议等待其完全采集，第二次及以后再次采集时将判断30分钟内采集重复文章次数是否达到3次来决定继续采集。</p></li> <li><p>如何自动采集下一个公众号的历史列表页</p> <p>在处于<code>采集代理模式</code>时，打开你想要采集的任意一个公众号的<code>历史文章列表</code>页面，会出现操作界面，目前你需要手动选择相应的选项并提交才会进行下一步的采集动作。</p></li> <li><p>如何采集文章评论数据</p> <p>在处于<code>采集代理模式</code>时，在微信内部浏览器中打开相应的文章即可，目前需要手动从微信中打开链接，如果在其他外部浏览器中打开仅会采集文章的基本信息，不会采集到评论信息</p></li> <li><p>如何采集文章阅读量数据</p> <p>在处于<code>采集代理模式</code>时，在微信内部浏览器中打开相应的文章即可，目前需要手动从微信中打开链接，如果在其他外部浏览器中打开仅会采集文章的基本信息，不会采集到阅读量信息</p></li> <li><p>如何生成文章的图片以便本地存储和预览</p> <p>先关闭<code>采集代理</code>开关，然后在软件文章列表页右侧操作<code>生成</code>按钮即可，生成成功后，可以点击<code>查看</code>按钮，浏览生成的文章图片内容。</p></li> <li><p>如何批量生成文章图片</p> <p>先关闭<code>采集代理</code>开关，然后在软件文章列表页上方启用<code>后台文章图片生成任务</code>开关即可，将会从<code>最早发布的未生成图片的文章</code>开始生成文章图片并存放在个人的主目录下。</p></li> <li><p>无法采集列表页数据</p> <p>请确认页面是否有操作界面提示信息，如没有可能是代理设置失败问题。可尝试手动将<code>127.0.0.1:6879</code>设置到系统代理并启用。然后刷新页面再次尝试采集。
多次失败的情况下，建议先关闭软件再重启，然后再启用<code>采集代理</code>开关，及手动设置代理。</p></li></ol> <h3 id="监控模式"><a href="#监控模式" class="header-anchor">#</a> 监控模式</h3> <p>目前软件支持对微信进行公众号文章推送数据的监控及采集，首先启用<code>监控模式</code>，然后到<code>PC微信</code>界面去点击<code>新开微信</code>按钮，支持多开，每个微信客户端需要不同的账号登录。
当公众号有推送文章数据过来的时候，软件将会采集处理并展示到软件的文章列表界面。</p> <blockquote><p>支持列表</p></blockquote> <table><thead><tr><th style="text-align:center;">wechat</th> <th style="text-align:center;">wechatwin.dll</th></tr></thead> <tbody><tr><td style="text-align:center;">2.7.1.88</td> <td style="text-align:center;">2.7.1.88</td></tr> <tr><td style="text-align:center;">2.7.2.76</td> <td style="text-align:center;">2.7.2.76</td></tr> <tr><td style="text-align:center;">2.8.0.78</td> <td style="text-align:center;">2.7.2.78</td></tr> <tr><td style="text-align:center;">2.8.0.88</td> <td style="text-align:center;">2.8.0.88</td></tr> <tr><td style="text-align:center;">2.8.0.106</td> <td style="text-align:center;">2.8.0.106</td></tr></tbody></table> <h2 id="开发"><a href="#开发" class="header-anchor">#</a> 开发</h2> <h3 id="技术栈及语言"><a href="#技术栈及语言" class="header-anchor">#</a> 技术栈及语言</h3> <ol><li>nodejs</li> <li>electron</li> <li>vue</li> <li>nodejs native addons</li> <li>c++ dll</li> <li>powershell</li></ol> <h3 id="系统开发环境"><a href="#系统开发环境" class="header-anchor">#</a> 系统开发环境</h3> <pre><code>window10 x64
node v12.8.1 32位
python v2.7
Visual Studio 2017
</code></pre> <h3 id="安装nvm"><a href="#安装nvm" class="header-anchor">#</a> 安装nvm</h3> <table><thead><tr><th style="text-align:center;">操作系统</th> <th style="text-align:center;">二进制包</th></tr></thead> <tbody><tr><td style="text-align:center;">win10</td> <td style="text-align:center;"><a href="https://github.com/coreybutler/nvm/releases" target="_blank" rel="noopener noreferrer">nvm-windows<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></td></tr></tbody></table> <h3 id="安装nodejs"><a href="#安装nodejs" class="header-anchor">#</a> 安装Nodejs</h3> <div class="language-sh extra-class"><pre class="language-sh"><code><span class="token comment">## 安装nodejs版本</span>
nvm <span class="token function">install</span> <span class="token number">12.8</span>.1 <span class="token number">32</span>

<span class="token comment">## 指定nodejs版本</span>
nvm use <span class="token number">12.8</span>.1 <span class="token number">32</span>

<span class="token comment">## 查看生效nodejs版本</span>
nvm list
node -v
</code></pre></div><h3 id="安装yarn"><a href="#安装yarn" class="header-anchor">#</a> 安装yarn</h3> <div class="language-sh extra-class"><pre class="language-sh"><code><span class="token function">npm</span> <span class="token function">install</span> -g <span class="token function">yarn</span>
</code></pre></div><h3 id="更新依赖"><a href="#更新依赖" class="header-anchor">#</a> 更新依赖</h3> <div class="language-sh extra-class"><pre class="language-sh"><code><span class="token comment">## 主项目依赖</span>
<span class="token function">yarn</span>

<span class="token comment">## worker依赖</span>
<span class="token builtin class-name">cd</span> src/worker <span class="token operator">&amp;&amp;</span> <span class="token function">yarn</span>
</code></pre></div><h3 id="安装python-2-7"><a href="#安装python-2-7" class="header-anchor">#</a> 安装Python 2.7</h3> <p><a href="https://www.python.org/downloads/release/python-2717/" target="_blank" rel="noopener noreferrer">Python 下载地址<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></p> <h3 id="安装visual-studio-2017"><a href="#安装visual-studio-2017" class="header-anchor">#</a> 安装Visual Studio 2017</h3> <p><a href="https://visualstudio.microsoft.com/downloads/" target="_blank" rel="noopener noreferrer">Visual Studio 下载地址<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></p> <h2 id="下载源码"><a href="#下载源码" class="header-anchor">#</a> 下载源码</h2> <div class="language-sh extra-class"><pre class="language-sh"><code><span class="token builtin class-name">cd</span> ~/Desktop
<span class="token function">git</span> clone https://github.com/lunnlew/weicai-scraper.git
</code></pre></div><h2 id="编译打包"><a href="#编译打包" class="header-anchor">#</a> 编译打包</h2> <p>以<code>Visual Studio 2017</code>为例，原生模块<code>WeChatCtl</code>、<code>WeChatHelper</code>及<code>WeicaiBinding</code>支持通过ide运行构建及命令行方式运行构建，ide方式运行相应的<code>sln</code>文件即可</p> <h3 id="编译weicaibinding"><a href="#编译weicaibinding" class="header-anchor">#</a> 编译WeicaiBinding</h3> <div class="language-cmd extra-class"><pre class="language-text"><code># 原始命令
cd src/native/WeicaiBinding &amp;&amp; cross-env HOME=~/.electron-gyp node-gyp configure &amp;&amp; cross-env HOME=~/.electron-gyp node-gyp rebuild --target=7.1.3 --runtime=electron --arch=ia32  --dist-url=https://electronjs.org/headers

# 或者项目目录运行
yarn run native:build-WeicaiBinding-ia32

</code></pre></div><h3 id="编译wechatctl"><a href="#编译wechatctl" class="header-anchor">#</a> 编译WeChatCtl</h3> <div class="language-cmd extra-class"><pre class="language-text"><code>#命令方式
##调试版本
&quot;C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/Common7/IDE/devenv&quot; src/native/WeChatCtl/WeChatCtl.sln /Build &quot;Debug|x86&quot;
##发布版本版本
&quot;C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/Common7/IDE/devenv&quot; src/native/WeChatCtl/WeChatCtl.sln /Build &quot;Release|x86&quot;

# 或者项目目录运行构建Release
yarn run native:build-WeChatCtl
</code></pre></div><h3 id="编译wechathelper"><a href="#编译wechathelper" class="header-anchor">#</a> 编译WeChatHelper</h3> <div class="language-cmd extra-class"><pre class="language-text"><code>#命令方式
##调试版本
&quot;C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/Common7/IDE/devenv&quot; src/native/WeChatHelper/WeChatHelper.sln /Build &quot;Debug|x86&quot;
##发布版本版本
&quot;C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/Common7/IDE/devenv&quot; src/native/WeChatHelper/WeChatHelper.sln /Build &quot;Release|x86&quot;

# 或者项目目录运行构建Release
yarn run native:build-WeChatHelper
</code></pre></div><h3 id="运行开发模式"><a href="#运行开发模式" class="header-anchor">#</a> 运行开发模式</h3> <div class="language-sh extra-class"><pre class="language-sh"><code><span class="token function">yarn</span> run electron:serve
</code></pre></div><h3 id="打包主程序"><a href="#打包主程序" class="header-anchor">#</a> 打包主程序</h3> <div class="language-sh extra-class"><pre class="language-sh"><code><span class="token function">yarn</span> run electron:build
</code></pre></div><h2 id="调试远程注入dll"><a href="#调试远程注入dll" class="header-anchor">#</a> 调试远程注入DLL</h2> <p>以<code>WeChatHelper</code>为例</p> <h3 id="编译wechathelper-2"><a href="#编译wechathelper-2" class="header-anchor">#</a> 编译WeChatHelper</h3> <p>参考前文使用<code>vs2017</code>运行项目编译</p> <h3 id="编译detours"><a href="#编译detours" class="header-anchor">#</a> 编译Detours</h3> <div class="language-sh extra-class"><pre class="language-sh"><code><span class="token builtin class-name">cd</span> ~/Desktop
<span class="token function">git</span> clone https://github.com/microsoft/Detours.git
</code></pre></div><p>运行<code>vs2017工具x86 Native Tools Command Prompt for VS 2017</code></p> <div class="language-sh extra-class"><pre class="language-sh"><code><span class="token builtin class-name">cd</span> ~/Desktop/Detours
nmake /f Makefile
</code></pre></div><h3 id="修改原始程序iat"><a href="#修改原始程序iat" class="header-anchor">#</a> 修改原始程序IAT</h3> <div class="language- extra-class"><pre class="language-text"><code># 进入要调试的应用主程序
cd D:/Applications/WeChat
# 将要调试的dll复制到程序目录
cp ~/Desktop/weicai-scraper/src/native/WeChatHelper/Debug/WeChatHelper.dll .
cp ~/Desktop/weicai-scraper/src/native/WeChatHelper/Debug/WeChatHelper.pdb .
# 修改IAT
~/Desktop/Detours/bin.X86/setdll.exe /d:WeChatHelper.dll WeChat.exe
# 恢复IAT
~/Desktop/Detours/bin.X86/setdll.exe /r WeChat.exe

</code></pre></div><h3 id="配置vs2017的本地调试设置"><a href="#配置vs2017的本地调试设置" class="header-anchor">#</a> 配置vs2017的本地调试设置</h3> <p>将<code>配置属性</code>-<code>调试</code>-<code>本地windows调试</code>:
<code>命令</code>改为主程序地址如<code>D:/Applications/WeChat/WeChat.exe</code>;
<code>工作目录</code>改为主程序目录址如<code>D:/Applications/WeChat</code></p> <h3 id="运行调试"><a href="#运行调试" class="header-anchor">#</a> 运行调试</h3> <p>在DLL入口下个断点， 启动调试即可。</p> <h2 id="文档生成"><a href="#文档生成" class="header-anchor">#</a> 文档生成</h2> <h3 id="安装vuepress"><a href="#安装vuepress" class="header-anchor">#</a> 安装vuepress</h3> <div class="language-sh extra-class"><pre class="language-sh"><code><span class="token function">yarn</span> <span class="token function">add</span> vuepress --dev
</code></pre></div><h3 id="构建文档"><a href="#构建文档" class="header-anchor">#</a> 构建文档</h3> <div class="language-sh extra-class"><pre class="language-sh"><code><span class="token function">yarn</span> run docs:build
</code></pre></div><h2 id="开源许可"><a href="#开源许可" class="header-anchor">#</a> 开源许可</h2> <p>基于 <a href="https://opensource.org/licenses/MIT" target="_blank" rel="noopener noreferrer">MIT license<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a> 许可进行开源。</p></div> <footer class="page-edit"><!----> <!----></footer> <!----> </main></div><div class="global-ui"></div></div>
    <script src="/assets/js/app.c7adfe4a.js" defer></script><script src="/assets/js/2.4e4a3910.js" defer></script><script src="/assets/js/4.ef8676b3.js" defer></script>
  </body>
</html>
